package com.shengde.jinwawaforleader.utils;

import android.os.Environment;

import java.io.File;

public class StorageUtils {
	/**外部存储卡的路径**/
	private static final String SD_PATH = Environment.getExternalStorageDirectory().getAbsolutePath();
	/**悠然缓存目录**/
	private static final String YR_CACHE_DIR = "com.youran";
	public static final String YR_CAMERA_DIR = SD_PATH + File.separator + YR_CACHE_DIR+ File.separator;
	/**图片缓存目录**/
	private static final String BASE_IMAGE_CACHE = SD_PATH + File.separator
																				+ YR_CACHE_DIR + File.separator
																				+"cache/images";
	/**
	 *     获取缓存的目录
	 *     1. 判断是否有sdcard
	 *     2. 没有sdcard 直接缓存到内存
	 * @return
	 */
	/*public static File getCacheDirectory(Context context) {
		if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
			return new File(BASE_IMAGE_CACHE);
		}	
		return new File(com.nostra13.universalimageloader.utils.StorageUtils.getCacheDirectory(context).getPath());
	}*/
	
	public static boolean checkSDCard(){
		if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){  //判断是否存在SD卡
			return true;
		}else{
			return false;
		}
	}
}
